<template>
	<om-formsub-outer :index="index" :checkedit="checkedit">
		<om-autoform @deleteItem="deleteUserItem" ref="autoform" :initConfigData="autoformdata" :initValue="initValue"></om-autoform>
	</om-formsub-outer>
</template>

<script>
	import {buildSubFormData, subOnLoad, changeEditor,configSelectData,hasValue} from '@/static/js/formUtil.js';
	import { ignoreHtml,ptFloat,minusF,getDateStr} from '@/static/js/common.js';
	import urlUtil from '@/static/js/urlUtil.js'
	import { mapState } from 'pinia';
	import {useLoginUserStore} from '@/stores/login-user.js';
	export default {
		provide() {
			return {
				formPage: this
			};
		},
		data() {
			return buildSubFormData({
				visitShowIdCacheKey:'mar-yxhd-customerContactReport-title2-visitShowId-cache',
				customerCacheKey:'mar-yxhd-customerContactReport-title2-customer-cache',
				visitTypeIdStrCacheKey:"mar-yxhd-customerContactReport-title2-visitTypeIdStr-cache",
				peopleCacheKey:"mar-yxhd-customerContactReport-title2-people-cache",
				visitUserCacheKey:'mar-yxhd-customerContactReport-title2-visitUser-cache',
				visitTargetIdStrCacheKey:"mar-yxhd-customerContactReport-title2-visitTargetIdStr-cache",
				visitPreparationIdStrCacheKey:"mar-yxhd-customerContactReport-title2-visitPreparationIdStr-cache",
				exchangePointIdStrCacheKey:"mar-yxhd-customerContactReport-title2-exchangePointIdStr-cache",
				initdataList: '[]',
			})
		},
		computed: {
			...mapState(useLoginUserStore, ['userName', 'userId'])
		},
		methods:{
			clearVisitShow(){
				let _that = this;
				_that.$refs.autoform.clear('title2', 'visitShowId');
				_that.$refs.autoform.clear('title2', 'visitShowCode');
				_that.$refs.autoform.clear('title2', 'customerObjId');
				_that.$refs.autoform.clear('title2', 'customerId');
				_that.$refs.autoform.clear('title2', 'customerName');
				_that.$refs.autoform.clear('title2', 'customerShortName');
				_that.$refs.autoform.clear('title2', 'transactiontatusId');
				_that.$refs.autoform.clear('title2', 'transactiontatusName');
				_that.$refs.autoform.clear('title2', 'planStartDate');
				_that.$refs.autoform.clear('title2', 'timeRangeId');
				_that.$refs.autoform.clear('title2', 'timeRangeName');
				_that.$refs.autoform.clear('title2', 'planEndDate');
				_that.$refs.autoform.clear('title2', 'problemRemark');
				_that.$refs.autoform.clear('title2', 'signInTime');
				_that.$refs.autoform.clear('title2', 'signOutTime');
				_that.$refs.autoform.clear('title2', 'startTime');
				_that.$refs.autoform.clear('title2', 'endTime');
				_that.$refs.autoform.clear('title2', 'remark');
				_that.$refs.autoform.clear('title2', 'contactProblemRemark');
				_that.$refs.autoform.clear('title2', 'contactTypeId');
				_that.$refs.autoform.clear('title2', 'contactTypeName');
				_that.$refs.autoform.clear('title2', 'visitTypeIdStr');
				_that.$refs.autoform.clear('title2', 'visitTypeNameStr');
				_that.$refs.autoform.clear('title2', 'visitTargetIdStr');
				_that.$refs.autoform.clear('title2', 'visitTargetNameStr');
				_that.$refs.autoform.clear('title2', 'visitPreparationIdStr');
				_that.$refs.autoform.clear('title2', 'visitPreparationNameStr');
				_that.$refs.autoform.changeEditor("title2","contactTypeId","type","labelbox")
				_that.$refs.autoform.changeEditor("title2","visitTypeIdStr","type","labelbox")
				_that.$refs.autoform.changeEditor("title2","visitTargetIdStr","type","labelbox")
				_that.$refs.autoform.changeEditor("title2","visitPreparationIdStr","type","labelbox")
				_that.$refs.autoform.clear('title2', 'exchangePointIdStr');
				_that.$refs.autoform.clear('title2', 'exchangePointNameStr');
				_that.$refs.autoform.clear('title2', 'exchangePointList');
				_that.$refs.autoform.changeEditor("title2","exchangePointIdStr","type","multilinkbox")
			},
			clearCustomer(){
				let _that = this;
				_that.$refs.autoform.clear('title2', 'visitShowId');
				_that.$refs.autoform.clear('title2', 'visitShowCode');
				_that.$refs.autoform.clear('title2', 'customerObjId');
				_that.$refs.autoform.clear('title2', 'customerId');
				_that.$refs.autoform.clear('title2', 'customerName');
				_that.$refs.autoform.clear('title2', 'customerShortName');
				_that.$refs.autoform.clear('title2', 'transactiontatusId');
				_that.$refs.autoform.clear('title2', 'transactiontatusName');
				_that.$refs.autoform.clear('title2', 'planStartDate');
				_that.$refs.autoform.clear('title2', 'timeRangeId');
				_that.$refs.autoform.clear('title2', 'timeRangeName');
				_that.$refs.autoform.clear('title2', 'planEndDate');
				_that.$refs.autoform.clear('title2', 'problemRemark');
				_that.$refs.autoform.clear('title2', 'signInTime');
				_that.$refs.autoform.clear('title2', 'signOutTime');
				_that.$refs.autoform.clear('title2', 'startTime');
				_that.$refs.autoform.clear('title2', 'endTime');
				_that.$refs.autoform.clear('title2', 'remark');
				_that.$refs.autoform.clear('title2', 'contactProblemRemark');
				_that.$refs.autoform.clear('title2', 'contactTypeId');
				_that.$refs.autoform.clear('title2', 'contactTypeName');
				_that.$refs.autoform.clear('title2', 'visitTypeIdStr');
				_that.$refs.autoform.clear('title2', 'visitTypeNameStr');
				_that.$refs.autoform.clear('title2', 'visitTargetIdStr');
				_that.$refs.autoform.clear('title2', 'visitTargetNameStr');
				_that.$refs.autoform.clear('title2', 'visitPreparationIdStr');
				_that.$refs.autoform.clear('title2', 'visitPreparationNameStr');
				_that.$refs.autoform.changeEditor("title2","contactTypeId","type","selectbox")
				_that.$refs.autoform.changeEditor("title2","visitTypeIdStr","type","multilinkbox")
				_that.$refs.autoform.changeEditor("title2","visitTargetIdStr","type","multilinkbox")
				_that.$refs.autoform.changeEditor("title2","visitPreparationIdStr","type","multilinkbox")
				_that.$refs.autoform.clear('title2', 'exchangePointIdStr');
				_that.$refs.autoform.clear('title2', 'exchangePointNameStr');
				_that.$refs.autoform.clear('title2', 'exchangePointList');
				_that.$refs.autoform.changeEditor("title2","exchangePointIdStr","type","labelbox")
			},
			onSelectVisitPostId(item){
				let _that = this;
				_that.$refs.autoform.formdata.visitPostId = item.id
				_that.$refs.autoform.formdata.visitPostName = item.postName
				_that.$refs.autoform.formdata.visitInstId = item.instId
				_that.$refs.autoform.formdata.visitInstName = item.instName
			},
			clearVisitPostId(){
				let _that = this;
				_that.$refs.autoform.clear('title2', 'visitPostId');
				_that.$refs.autoform.clear('title2', 'visitInstId');
			},
			deleteUserItem(){
				let _that = this
				let peopleIds = []
				if(_that.$refs.autoform.formdata.peopleId){
					peopleIds = _that.$refs.autoform.formdata.peopleId.split(",")
				}
				_that.$refs.autoform.changeEditor('title2', 'peopleId', {
					linkParam: {
						namefield: urlUtil.userPageUrl().namefield,
						searchfield: "q",
						cachename: _that.peopleCacheKey,
						placeholder: urlUtil.userPageUrl().prompt,
						pagination: true,
						hasNum:peopleIds.length
					}
				});
			}
		},
		onShow() {
			let _that = this
			if(_that.$refs.autoform){
				uni.getStorage({
					key:_that.visitShowIdCacheKey,
					success:(res)=>{
						if(res.data){
							let d = res.data
							let formdata = _that.$refs.autoform.formdata
							
							_that.om.request('visitContact/getVisitDataList', {
								visitShowIdStr: d.visitShowId
							}).then(zres => {
								formdata.visitShowId = zres.value[0].visitShowId
								formdata.visitShowCode = zres.value[0].visitShowCode
								formdata.customerObjId = zres.value[0].customerObjId
								formdata.customerCode = zres.value[0].customerCode
								formdata.customerShortName = zres.value[0].customerShortName
								formdata.customerId = zres.value[0].customerId
								formdata.customerName = zres.value[0].customerName
								formdata.transactiontatusId = zres.value[0].transactiontatusId
								formdata.transactiontatusName = zres.value[0].transactiontatusName
								formdata.planStartDate = zres.value[0].planStartDate
								formdata.planEndDate = zres.value[0].planEndDate
								formdata.timeRangeId = zres.value[0].timeRangeId
								formdata.timeRangeName = zres.value[0].timeRangeName
								formdata.problemRemark = zres.value[0].problemRemark
								formdata.signInTime = zres.value[0].signInTime
								formdata.signOutTime = zres.value[0].signOutTime
								formdata.startTime = zres.value[0].startTime ? zres.value[0].startTime.substring(0,16) : ''
								formdata.endTime = zres.value[0].endTime ? zres.value[0].endTime.substring(0,16) : ''
								formdata.remark = zres.value[0].remark
								formdata.contactProblemRemark = zres.value[0].contactProblemRemark
								formdata.contactTypeId = zres.value[0].contactTypeId
								formdata.contactTypeName = zres.value[0].contactTypeName
								formdata.visitTypeIdStr = zres.value[0].visitTypeIdStr
								formdata.visitTypeNameStr = zres.value[0].visitTypeNameStr
								formdata.visitTargetIdStr = zres.value[0].visitTargetIdStr
								formdata.visitTargetNameStr = zres.value[0].visitTargetNameStr
								formdata.visitPreparationIdStr = zres.value[0].visitPreparationIdStr
								formdata.visitPreparationNameStr = zres.value[0].visitPreparationNameStr
								formdata.exchangePointIdStr = zres.value[0].exchangePointIdStr
								formdata.exchangePointNameStr = zres.value[0].exchangePointNameStr
								
								_that.initdataList = JSON.stringify(zres.value[0].exchangePointList)
								if(_that.initdataList){
									_that.$refs.autoform.changeEditor("title2","exchangePointIdStr","type","linkbox")
									_that.$refs.autoform.changeEditor("title2","exchangePointIdStr",{
										"link":"../../public/pageEditSearch/pageEditSearch",
										"linkParam":{
											defaultData: _that.initdataList,
											cachename:_that.exchangePointIdStrCacheKey,
											initload:true,
											namefield:'exchangePointName',
											namefieldValue:'pointRemark',
										}
									})
								}else{
									_that.initdataList = '[]'
									_that.$refs.autoform.changeEditor("title2","exchangePointIdStr","type","labelbox")
								}
								
								_that.$refs.autoform.changeEditor("title2","contactTypeId","type","labelbox")
								_that.$refs.autoform.changeEditor("title2","visitTargetIdStr","type","labelbox")
								_that.$refs.autoform.changeEditor("title2","visitPreparationIdStr","type","labelbox")
								_that.$refs.autoform.changeEditor("title2","visitTypeIdStr","type","labelbox")
								uni.removeStorage({
									key:_that.visitShowIdCacheKey
								})						
							})
							
							
						}
					}
				});
				uni.getStorage({
					key:_that.customerCacheKey,
					success:(res)=>{
						if(res.data){
							let d = res.data
							let formdata = _that.$refs.autoform.formdata
							
							formdata.customerObjId = d.customerObjId
							formdata.customerCode = d.customerCode
							formdata.customerName = d.customerName
							formdata.customerShortName = d.customerShortName
							formdata.customerId = d.customerId
							formdata.transactiontatusId = d.transactiontatusId
							formdata.transactiontatusName = d.transactiontatusName
							formdata.planStartDate = d.planStartDate
							formdata.planEndDate = d.planEndDate
							formdata.timeRangeId = d.timeRangeId
							formdata.timeRangeName = d.timeRangeName
							formdata.problemRemark = d.problemRemark
							formdata.signInTime = d.signInTime
							formdata.signOutTime = d.signOutTime
							formdata.startTime = d.startTime ? d.startTime.substring(0,16) : ''
							formdata.endTime = d.endTime ? d.endTime.substring(0,16) : ''
							formdata.remark = d.remark
							formdata.contactProblemRemark = d.contactProblemRemark
							
							formdata.contactTypeId = d.contactTypeId
							formdata.contactTypeName = d.contactTypeName
							// _that.$refs.autoform.changeEditor('title2', 'contactTypeId', {
							// 	initSelect: zres.value
							// })
							
							formdata.visitTypeIdStr = d.visitTypeIdStr
							formdata.visitTypeNameStr = d.visitTypeNameStr
							_that.$refs.autoform.changeEditor('title2', 'visitTypeIdStr', {
								initSelect: d
							})
							formdata.visitTargetIdStr = d.visitTargetIdStr
							formdata.visitTargetNameStr = d.visitTargetNameStr
							_that.$refs.autoform.changeEditor('title2', 'visitTargetIdStr', {
								initSelect: d
							})
							formdata.visitPreparationIdStr = d.visitPreparationIdStr
							formdata.visitPreparationNameStr = d.visitPreparationNameStr
							_that.$refs.autoform.changeEditor('title2', 'visitPreparationIdStr', {
								initSelect: d
							})
							
							formdata.exchangePointIdStr = d.exchangePointIdStr
							formdata.exchangePointNameStr = d.exchangePointNameStr
							if(d.exchangePointList.length>0){
								_that.initdataList = JSON.stringify(d.exchangePointList)
								_that.$refs.autoform.changeEditor("title2","exchangePointIdStr","type","linkbox")
								_that.$refs.autoform.changeEditor("title2","exchangePointIdStr",{
									"link":"../../public/pageEditSearch/pageEditSearch",
									"linkParam":{
										defaultData: _that.initdataList,
										cachename:_that.exchangePointIdStrCacheKey,
										initload:true,
										namefield:'exchangePointName',
										namefieldValue:'pointRemark',
									}
								})
							}else{
								_that.initdataList = '[]'
								_that.$refs.autoform.changeEditor("title2","exchangePointIdStr","type","labelbox")
							}
							_that.$refs.autoform.changeEditor("title2","contactTypeId","type","selectbox")
							_that.$nextTick(function(){
								_that.$refs.autoform.initSelectIndex('title2',"contactTypeId");
							})
							_that.$refs.autoform.changeEditor("title2","visitTypeIdStr","type","multilinkbox")
							_that.$refs.autoform.changeEditor("title2","visitTargetIdStr","type","multilinkbox")
							_that.$refs.autoform.changeEditor("title2","visitPreparationIdStr","type","multilinkbox")
							
							uni.removeStorage({
								key:_that.customerCacheKey
							})
						}
					}
				})
				uni.getStorage({
					key: _that.peopleCacheKey,
					success: function(res) {
						if (res.data) {
							let d = res.data;
							var formdata = _that.$refs.autoform.formdata;
							if(d.length){
								let idStr = []
								let nameStr = []
								let peopleId = ''
								if(formdata.peopleId){
									peopleId = formdata.peopleId.split(',')
								}
								for(let index in d){
									if(peopleId.indexOf(d[index].id+'') == -1){
										 idStr.push(d[index].id)
										 nameStr.push(d[index].username)
									}
								}
								idStr.map(e =>e).join(",")
								nameStr.map(e =>e).join(",");
								if(!formdata.peopleId){
									formdata.peopleId += idStr
									formdata.people += nameStr
								}else{
									if(idStr.length){
										formdata.peopleId += ','+idStr
										formdata.people +=','+ nameStr
									}
								}
							}
							uni.removeStorage({
								key: _that.peopleCacheKey
							});
							let peopleList = []
							let peopleIds =_that.$refs.autoform.formdata.peopleId.split(',')
							let people = _that.$refs.autoform.formdata.people.split(',')
							_that.$refs.autoform.changeEditor('title2', 'peopleId',{
								linkParam:{
									namefield: urlUtil.userPageUrl().namefield,
									searchfield: "q",
									cachename: _that.peopleCacheKey,
									placeholder: urlUtil.userPageUrl().prompt,
									pagination: true,
									hasNum:peopleIds.length
								}
							})
						}
					}
				});
				uni.getStorage({
					key:_that.visitTypeIdStrCacheKey,
					success:(res)=>{
						if(res.data){
							let d = res.data
							let formdata = _that.$refs.autoform.formdata
							formdata.visitTypeIdStr = d.map(e=>e.id).join(',')
							formdata.visitTypeNameStr = d.map(e=>e.text).join(',')
							_that.$refs.autoform.changeEditor('title2', 'visitTypeIdStr', {
								initSelect: d
							})
							uni.removeStorage({
								key:_that.visitTypeIdStrCacheKey
							})
						}
					}
				})
				uni.getStorage({
					key:_that.visitUserCacheKey,
					success:(res)=>{
						if(res.data){
							let d = res.data[0]
							let formdata = _that.$refs.autoform.formdata
							formdata.visitUserId = d.id
							formdata.visitUserName = d.username
							_that.om.request('orgInstPosUserOfficial/getPosComboboxByUser', {
								userId: d.id,
								flag: true,
							}).then(zres => {
								_that.$refs.autoform.changeEditor('title2', 'visitPostId', 'data', configSelectData(zres, 'id', 'posname'));
								uni.removeStorage({
									key:_that.visitUserCacheKey
								})
							})
						}
					}
				})
				uni.getStorage({
					key:_that.visitTargetIdStrCacheKey,
					success:(res)=>{
						if(res.data){
							let d = res.data
							let formdata = _that.$refs.autoform.formdata
							formdata.visitTargetIdStr = d.map(e=>e.id).join(',')
							formdata.visitTargetNameStr = d.map(e=>e.text).join(',')
							_that.$refs.autoform.changeEditor('title2', 'visitTargetIdStr', {
								initSelect: d
							})
							uni.removeStorage({
								key:_that.visitTargetIdStrCacheKey
							})
						}
					}
				})
				uni.getStorage({
					key:_that.visitPreparationIdStrCacheKey,
					success:(res)=>{
						if(res.data){
							let d = res.data
							let formdata = _that.$refs.autoform.formdata
							formdata.visitPreparationIdStr = d.map(e=>e.id).join(',')
							formdata.visitPreparationNameStr = d.map(e=>e.text).join(',')
							_that.$refs.autoform.changeEditor('title2', 'visitPreparationIdStr', {
								initSelect: d
							})
							uni.removeStorage({
								key:_that.visitPreparationIdStrCacheKey
							})
						}
					}
				})
				uni.getStorage({
					key:_that.exchangePointIdStrCacheKey,
					success:(res)=>{
						if(res.data){
							let d = res.data
							let formdata = _that.$refs.autoform.formdata
							let arr = JSON.parse(d)
							_that.initdataList = d
							_that.$refs.autoform.changeEditor("title2","exchangePointIdStr",{
								"link":"../../public/pageEditSearch/pageEditSearch",
								"linkParam":{
									defaultData: _that.initdataList,
									cachename:_that.exchangePointIdStrCacheKey,
									initload:true,
									namefield:'exchangePointName',
									namefieldValue:'pointRemark',
								}
							})
							
							formdata.exchangePointList = arr
							formdata.exchangePointIdStr = arr.map(e=>e.exchangePointId).join(',')
							formdata.exchangePointNameStr = arr.map(e=>e.exchangePointName + (e.pointRemark ? '('+ e.pointRemark+')' : '')).join(',')
							uni.removeStorage({
								key:_that.exchangePointIdStrCacheKey
							})
						}
					}
				})
			}
		},
		onLoad(e) {
			let _that = this
			subOnLoad(_that, e, function() {
			if(e.configDataCacheKey){
				uni.getStorage({
					key: e.configDataCacheKey,
					success: function(res) {
						if(res.data && Object.prototype.toString.call(res.data)==='[object Array]'){
							_that.autoformdata = res.data
							Object.assign(_that.initValue, _that.formdata)
							_that.autoformdata[0].order = _that.order
								changeEditor("title2","visitShowId",{
									"link":"../../public/pageSearch/pageSearch",
									"linkParam":{
										other:JSON.stringify({
											userId:_that.userId
										}),
										url:"visitContact/getVisitContactDataPager",
										cachename:_that.visitShowIdCacheKey,
										initload:true,
										searchfield: 'q',
										namefield:'visitShowCode',
										notefield:'customerName',
									}
								},null,_that.autoformdata)
								
								changeEditor("title2","customerObjId",{
									"link":"../../public/pageSearch/pageSearch",
									"linkParam":{
										other:JSON.stringify({
											userId:_that.userId
										}),
										url:"visitContact/getCustomerShowPager",
										cachename:_that.customerCacheKey,
										initload:true,
										searchfield: "q",
										namefield:'customerName',
										notefield:'contactTypeName',
										// suburl: 'visitContact/getVisitDataList',
										// subDataArr: JSON.stringify([{'visitShowIdStr':'visitShowId'}])
									}
								},null,_that.autoformdata)
								changeEditor("title2","visitTypeIdStr",{
									"linkParam":{
										other:JSON.stringify({
											code:'39081'
										}),
										url:"tsysdict/getComboTree",
										cachename:_that.visitTypeIdStrCacheKey,
										initload:true,
										namefield:'text'
									}
								},null,_that.autoformdata)
								changeEditor("title2","visitTargetIdStr",{
									"linkParam":{
										other:JSON.stringify({
											code:'39383'
										}),
										url:"tsysdict/getComboTree",
										cachename:_that.visitTargetIdStrCacheKey,
										initload:true,
										namefield:'text'
									}
								},null,_that.autoformdata)
								changeEditor("title2","visitPreparationIdStr",{
									"linkParam":{
										other:JSON.stringify({
											code:'39384'
										}),
										url:"tsysdict/getComboTree",
										cachename:_that.visitPreparationIdStrCacheKey,
										initload:true,
										namefield:'text'
									}
								},null,_that.autoformdata)
								changeEditor('title2',"visitUserId","isSearchUser",true,_that.autoformdata)
								changeEditor('title2',"visitUserId",{
									link:'../../public/searchUser/searchUser',
									"linkParam":{
										cachename: _that.visitUserCacheKey,
										isSingle:true
									}
								},null,_that.autoformdata)
								changeEditor('title2', 'peopleId','isSearchUser', true,  _that.autoformdata);
								changeEditor('title2', 'peopleId', {
									'link':'../../public/searchUser/searchUser',
									linkParam: {
										namefield: urlUtil.userPageUrl().namefield,
										searchfield: "q",
										cachename: _that.peopleCacheKey,
										placeholder: urlUtil.userPageUrl().prompt,
										pagination: true
									}
								}, null, _that.autoformdata);
								if(_that.formdata.exchangePointList){
									_that.initdataList = JSON.stringify(_that.formdata.exchangePointList)
								}
								
								changeEditor("title2","exchangePointIdStr",{
									"link":"../../public/pageEditSearch/pageEditSearch",
									"linkParam":{
										defaultData: _that.initdataList,
										cachename:_that.exchangePointIdStrCacheKey,
										initload:true,
										namefield:'exchangePointName',
										namefieldValue:'pointRemark',
									}
								},null,_that.autoformdata)

								_that.$nextTick(function(){
									_that.om.request("tsysdict/getCombobox",{code:'39424'}).then(res=>{
										_that.$refs.autoform.changeEditor('title2',"contactTypeId","data",configSelectData(res,"id","dicname"))
										_that.$refs.autoform.initSelectIndex('title2',"contactTypeId");
									})
									_that.om.request("dictZero/getListByCode",{code:'38586'}).then(res=>{
										_that.$refs.autoform.changeEditor('title2',"timeRangeId","data",configSelectData(res,"id","dicname"))
										_that.$refs.autoform.initSelectIndex('title2',"timeRangeId");
									})
									if(_that.$refs.autoform.formdata.visitPostId){
										_that.om.request('orgInstPosUserOfficial/getPosComboboxByUser', {
											userId: e.customerOwnerId,
											flag: true,
										}).then(zres => {
											_that.$refs.autoform.changeEditor('title2', 'visitPostId', 'data', configSelectData(zres, 'id', 'posname'));
											_that.$refs.autoform.initSelectIndex('title2',"visitPostId");
										})
									}
									
									let peopleIds = []
									if(_that.$refs.autoform.formdata.peopleId){
										peopleIds = _that.$refs.autoform.formdata.peopleId.split(",")
									}
									_that.$refs.autoform.changeEditor('title2', 'peopleId', {
										linkParam: {
											namefield: urlUtil.userPageUrl().namefield,
											searchfield: "q",
											cachename: _that.peopleCacheKey,
											placeholder: urlUtil.userPageUrl().prompt,
											pagination: true,
											hasNum:peopleIds.length
										}
									});
									if(_that.$refs.autoform.formdata.visitTypeIdStr){
										let objArr = []
										let ids = _that.$refs.autoform.formdata.visitTypeIdStr.split(",")
										let names = _that.$refs.autoform.formdata.visitTypeNameStr.split(",")
										for(let index in ids){
											let obj = {
												id:ids[index],
												dicname:names[index]
											}
											objArr.push(obj)
											_that.$refs.autoform.changeEditor('title2', 'visitTypeIdStr', {
												initSelect: objArr
											})
										}
									}
									if(_that.$refs.autoform.formdata.visitTargetIdStr){
										let objArr = []
										let ids = _that.$refs.autoform.formdata.visitTargetIdStr.split(",")
										let names = _that.$refs.autoform.formdata.visitTargetNameStr.split(",")
										for(let index in ids){
											let obj = {
												id:ids[index],
												dicname:names[index]
											}
											objArr.push(obj)
											_that.$refs.autoform.changeEditor('title2', 'visitTargetIdStr', {
												initSelect: objArr
											})
										}
									}
									if(_that.$refs.autoform.formdata.visitPreparationIdStr){
										let objArr = []
										let ids = _that.$refs.autoform.formdata.visitPreparationIdStr.split(",")
										let names = _that.$refs.autoform.formdata.visitPreparationNameStr.split(",")
										for(let index in ids){
											let obj = {
												id:ids[index],
												dicname:names[index]
											}
											objArr.push(obj)
											_that.$refs.autoform.changeEditor('title2', 'visitPreparationIdStr', {
												initSelect: objArr
											})
										}
									}
								})
							}
						}
					})
				}
			})
			// _that.$nextTick(function() {
			// 	if(e.edit == "true"){
			// 		_that.$refs.autoform.changeEditor("title2","customerObjId","type","labelbox")
			// 	}
			// })
		}
	}
</script>

<style>
</style>                                                                                                                                                                                                                                                                                                                                                                                                                                                         
